--- ./server/device.c.orig	2007-11-27 19:50:37.000000000 +0000
+++ ./server/device.c	2007-11-27 19:53:51.000000000 +0000
@@ -50,9 +50,12 @@
     void                  *out_data;      /* output data */
 };
 
+static unsigned int generic_device_map_access( unsigned int access );
+
 static void ioctl_call_dump( struct object *obj, int verbose );
 static int ioctl_call_signaled( struct object *obj, struct thread *thread );
 static void ioctl_call_destroy( struct object *obj );
+static unsigned int device_map_access( struct object *obj, unsigned int access );
 
 static const struct object_ops ioctl_call_ops =
 {
@@ -64,7 +67,7 @@
     no_satisfied,                     /* satisfied */
     no_signal,                        /* signal */
     no_get_fd,                        /* get_fd */
-    no_map_access,                    /* map_access */
+    device_map_access,                /* map_access */
     default_get_sd,                   /* get_sd */
     default_set_sd,                   /* set_sd */
     no_lookup_name,                   /* lookup_name */
@@ -95,7 +98,7 @@
     no_satisfied,                     /* satisfied */
     no_signal,                        /* signal */
     no_get_fd,                        /* get_fd */
-    no_map_access,                    /* map_access */
+    device_map_access,                /* map_access */
     default_get_sd,                   /* get_sd */
     default_set_sd,                   /* set_sd */
     no_lookup_name,                   /* lookup_name */
@@ -242,6 +245,19 @@
     }
 }
 
+static unsigned int generic_device_map_access( unsigned int access )
+{
+    if (access & GENERIC_READ)    access |= FILE_GENERIC_READ;
+    if (access & GENERIC_WRITE)   access |= FILE_GENERIC_WRITE;
+    if (access & GENERIC_EXECUTE) access |= FILE_GENERIC_EXECUTE;
+    if (access & GENERIC_ALL)     access |= FILE_ALL_ACCESS;
+    return access & ~(GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE | GENERIC_ALL);
+}
+
+static unsigned int device_map_access( struct object *obj, unsigned int access )
+{
+    return generic_device_map_access( access );
+}
